from django.shortcuts import render
from django.views import View


class IndexView(View):
    def get(self, request):
        data = {
            'name': "张三",
            "age": 18,
            "homes": [1, 2, 3, 4, 5, 6],
            "son": {
                'name': "大宝"
            }
        }

        return render(
            request,  # 请求对象
            'index.html',  # 模板文件
            context=data  # 后台数据
        )
